import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router';

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/Home'),
    // redirect: 'room-list',
    children: [
      {
        path: '/log',
        name: 'log',
        meta: { index: 10 },
        component: () => import('../views/Log')
      },
      {
        path: '/log-detail',
        name: 'log-detail',
        meta: { index: 11 },
        component: () => import('../views/LogDetail')
      },
      {
        path: '/room-list',
        name: 'room-list',
        meta: { index: 20 },
        component: () => import('../views/RoomList')
      },
      {
        path: '/room-detail',
        name: 'room-detail',
        meta: { index: 21 },
        component: () => import('../views/RoomDetail')
      },
      {
        path: '/user',
        name: 'user',
        meta: { index: 30 },
        component: () => import('../views/User')
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
